package com.csdj.wenjun.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.csdj.wenjun.entity.Huojiangjilu;
import com.csdj.wenjun.entity.Jifenjilu;
import com.csdj.wenjun.service.HuojiangjiluService;
import com.csdj.wenjun.service.JifenjiluService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author wenjun
 * @since 2022-01-12
 */
@RestController
@RequestMapping("/huojiangjilu")
public class HuojiangjiluController {
    @Autowired
    private HuojiangjiluService huojiangjiluService;
    @GetMapping("/selecthuojiangjilu")
    public List selectuserid(){
        QueryWrapper<Huojiangjilu> queryWrapper=new QueryWrapper<>();
        queryWrapper.lambda().orderByDesc(true,Huojiangjilu::getId);
        return huojiangjiluService.list(queryWrapper);
    }
    @GetMapping("/selecuserid")
    public List selecuserid(@RequestParam int id){
        QueryWrapper<Huojiangjilu> queryWrapper=new QueryWrapper<>();
        queryWrapper.lambda().eq(Huojiangjilu::getUserid,id);
        return huojiangjiluService.list(queryWrapper);
    }
}
